package com.koron.css2.netHall;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.swan.bean.MessageBean;

/**
 * com.koron.css2.netHall
 *
 * @author YinJiaLin
 * @since 2025/3/21
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class NewHallResult<T> extends MessageBean<T> {

    private int statusCode;
    private String message;

    @Override
    public T getData() {
        return super.getData();
    }

    public NewHallResult(int statusCode, String message, T data) {
        this.statusCode = statusCode;
        this.message = message;
        super.setData(data);
    }

    public static <T> NewHallResult<T> success(T data) {
        return new NewHallResult<>(200, "Success", data);
    }

    public static <T> NewHallResult<T> error(int statusCode, String message) {
        return new NewHallResult<>(statusCode, message, null);
    }

}
